package com.cal.utms.action.payment;

import com.cal.utms.dto.payment.ReceiptDto;
import com.cal.utms.model.payment.ReceiptModel;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ReceiptAction extends ActionSupport implements ModelDriven<ReceiptDto> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ReceiptDto receiptDto = new ReceiptDto();
	ReceiptModel model = new ReceiptModel();
	private int receiptid;
	private String receiptRequests;
	private int fundId;

	public String saveReceipt() {
		model.saveReceipt(receiptRequests, fundId, receiptDto);
		return Action.SUCCESS;
	}

	public String getRecipt() {
		receiptDto.setReceiptDtos(model.getReceipt());
		return Action.SUCCESS;
	}

	public String getConfirmRecipt() {
		receiptDto.setReceiptDtos(model.getConfirmReceipt());
		return Action.SUCCESS;
	}

	public String confirmReceipts() {
		model.confirmReceipt(receiptid, receiptDto);
		return Action.SUCCESS;
	}

	public String cancelConReceipt() {
		model.cancelConfirmReceipt(receiptid, receiptDto);
		return Action.SUCCESS;
	}

	public String receiptReject() {
		model.reject(receiptid, receiptDto);
		return Action.SUCCESS;
	}

	@Override
	public ReceiptDto getModel() {
		return receiptDto;
	}

	public ReceiptDto getReceiptDto() {
		return receiptDto;
	}

	public void setReceiptDto(ReceiptDto receiptDto) {
		this.receiptDto = receiptDto;
	}

	public int getReceiptid() {
		return receiptid;
	}

	public void setReceiptid(int receiptid) {
		this.receiptid = receiptid;
	}

	public String getReceiptRequests() {
		return receiptRequests;
	}

	public void setReceiptRequests(String receiptRequests) {
		this.receiptRequests = receiptRequests;
	}

	public int getFundId() {
		return fundId;
	}

	public void setFundId(int fundId) {
		this.fundId = fundId;
	}

}
